﻿using System;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005E7 RID: 1511
	[AddComponentMenu("")]
	[RequireComponent(typeof(Camera))]
	public class ImageEffectBase : MonoBehaviour
	{
		// Token: 0x06001DB5 RID: 7605 RVA: 0x00012BFE File Offset: 0x00010DFE
		public virtual void Start()
		{
			if (!SystemInfo.supportsImageEffects)
			{
				base.enabled = false;
				return;
			}
			if (!this.shader || !this.shader.isSupported)
			{
				base.enabled = false;
			}
		}

		// Token: 0x17000230 RID: 560
		// (get) Token: 0x06001DB6 RID: 7606 RVA: 0x00012C39 File Offset: 0x00010E39
		public Material material
		{
			get
			{
				if (this.m_Material == null)
				{
					this.m_Material = new Material(this.shader);
					this.m_Material.hideFlags = HideFlags.HideAndDontSave;
				}
				return this.m_Material;
			}
		}

		// Token: 0x06001DB7 RID: 7607 RVA: 0x00012C70 File Offset: 0x00010E70
		public virtual void OnDisable()
		{
			if (this.m_Material)
			{
				UnityEngine.Object.DestroyImmediate(this.m_Material);
			}
		}

		// Token: 0x0400179A RID: 6042
		public Shader shader;

		// Token: 0x0400179B RID: 6043
		public Material m_Material;
	}
}
